@extends('backend.layouts.default')

@section('content')
  <div class="box box-primary">
    <div class="box-header with-border">
      <h3 class="box-title">用户编辑</h3>
    </div>
    <form role="form" action="{{ route('users.update', $user->id) }}" method="post">
      <div class="box-body">
        <div class="form-group">
          <label for="name">头像</label>
          <dropzone action="https://up-z2.qiniup.com"
                    name="avater"
                    accepted-files="image/*"
                    domain="{{ env('QINIU_DEFAULT_DOMAIN') }}"
                    :default-keys="['{{ $user->avater }}']"
                    :form-data="{'token': '{{ upload_token('10MB', 'image/*') }}'}">
          </dropzone>
        </div>
        <div class="form-group">
          <label for="github_account">GitHub账号</label>
          <input type="text" class="form-control" id="github_account" name="github_account" placeholder="" value="{{ old('github_account', $user->github_account) }}">
        </div>
        @include('backend.layouts.errors')
      </div>
      <div class="box-footer text-right">
        {{ csrf_field() }}
        {{ method_field('put') }}
        <button type="submit" class="btn btn-primary">确认</button>
      </div>
    </form>
  </div>
@endsection
